package com.yx.front.controller;


import com.yx.front.config.global.CommonResult;
import com.yx.front.manager.NoticeUserManager;
import com.yx.front.model.base.BaseParam;
import com.yx.front.model.param.NoticeUserParam;
import com.yx.front.model.vo.NoticeUserVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 系统通知用户表 前端控制器
 * </p>
 *
 * @author YangXiong
 * @since 2023-04-23
 */
@RestController
@RequestMapping("/notice-user")
public class NoticeUserController {
    @Resource
    private NoticeUserManager noticeUserManager;

    @PostMapping("list")
    @ApiOperation("获取系统给用户的通知")
    public CommonResult<List<NoticeUserVo>> getList(@RequestBody BaseParam param){
        return noticeUserManager.getList(param);
    }

    @PostMapping("/read")
    @ApiOperation("根据id读取消息")
    public CommonResult<String> read(@RequestBody NoticeUserParam param){
      return noticeUserManager.read(param.getId());
    }
}

